let shopnav=document.querySelector("#shopnav");

// 渲染商场
function shoplist(){
    let res;
    ajax({
        url:"http://chst.vip:1234/api/getsitenav",
        success(res){
            res=res.result;
            let html="";
            res.forEach(item => {
                html+=`
                <div id="nav">
                <a href="${item.navHref}">
                    <img src="${item.navImg}" alt="">
                    <span>${item.navTitle}</span>
                </a>
                </div>
                `
            });
            shopnav.innerHTML=html
        },
        error(err,xhr){
            console.log(err);
        }
    })
}
shoplist();